import { createRouter, createWebHashHistory } from "vue-router";

let routes = [
  {
    path: "/home",
    name: "Home",
    component: () => import("@/components/Home.vue"),
  },
  {
    path: "/about/:name?",
    name: "About",
    component: () => import("@/components/About.vue"),
    props: true,
  },
  {
    path: "/",
    redirect: "/home", //重定向
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
export default router;
